package demo1;

class Base2 {
    public int b = 10;

    public void methodA(int a) {
        System.out.println("BASE::MethodA");
        System.out.println(a);
    }
}

class Derived2 extends Base2 {
    public void methodA() {
        System.out.println("Derived::MethodA");
    }

    public int b = 20;

    public void test() {
        System.out.println(super.b);
        super.methodA(5); // 可以通过super关键字来访问父类中的成员变量和成员方法
    }
}

public class Test3 {
    public static void main(String[] args) {
        Derived2 d2 = new Derived2();
        d2.methodA(1);

        System.out.println("+++++++++++++++++++++++");
        System.out.println(d2.b);
        d2.test();
    }
}
